from selenium.webdriver.common.by import By

URL = 'http://120.204.73.73:8034'

#登录成功后的所有操作的提示信息
messages_info=By.CLASS_NAME, 'ant-message-notice-content'

"""以下为登录模块涉及元素 配置信息"""
# 用户名
login_username = By.ID, "username"
# 密码
login_password = By.ID, "password"
# 验证码
login_verify_code = By.CLASS_NAME, "code"
login_input_verify_code = By.ID, "inputCode"
# 登录按钮
login_button = By.XPATH, '//*[@id="root"]/div/div/div/div/div[2]/form/button'
# 任务列表(判断是否登录成功)
login_text_list = By.CSS_SELECTOR, ".text-xl.font-bold"
# 错误提示信息
login_err_info = By.XPATH, "//*[@class='ant-message-custom-content ant-message-error']"
# 个人信息悬停
login_userinfo = By.CSS_SELECTOR, ".ant-dropdown-trigger.flex.items-center.gap-x-1.cursor-pointer"
# 退出登录链接
login_logout_link = By.CLASS_NAME, "ant-dropdown-menu-title-content"

"""以下为新建任务模块涉及元素 配置信息"""
# 新建任务按钮
task_add_new = By.XPATH, '//*[@id="root"]/div/div/div[2]/div[2]/main/div/div/div/div/div/div[2]/div[1]/a/button'
# 任务名称
task_name = By.ID, 'title'
# 任务描述
task_descript = By.ID, 'description'
# 下一步
task_next = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid.ml-4'
# 上传json配置
task_upload_config = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-link.ant-btn-color-primary.ant-btn-variant-link'
# 点击上传
task_text_primary = By.CLASS_NAME, 'text-primary'
# 文件路径
task_filepath = 'E:\\word\\1.json'
# 文件上传完成后确定
task_confirm = By.XPATH, "//button[@class='ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid']"
# 立即创建
task_establish = By.XPATH, '//*[@id="root"]/div/div/div[2]/div[2]/main/div/div/div/div/div/div[2]/div[2]/form/div[6]/div/div/div/div/button[1]'
# 未输入任务名称
task_add_empty_task_name = By.XPATH, '//*[@id="title_help"]/div'
# 未输入任务描述
task_add_empty_task_descript = By.XPATH, '//*[@id="description_help"]/div'
# 创建已成功
task_add_establish_success = By.CLASS_NAME, "ant-modal-confirm-content"
# 点击任务管理，返回到任务管理页面
task_management = By.CSS_SELECTOR, ".ant-menu-item.ant-menu-item-selected.ant-menu-item-only-child.ant-pro-base-menu-inline-menu-item"



"""以下是查看任务模块涉及元素 配置信息"""
# 编辑任务
edit_task = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-link.ant-btn-color-primary.ant-btn-variant-link.pr-0'
# 保存
task_save = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid.mr-4'
# 预览配置按钮
task_look_config_button = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-link.ant-btn-color-primary.ant-btn-variant-link.ant-btn-sm'
# 导出配置按钮
task_export_config_button = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-link.ant-btn-color-primary.ant-btn-variant-link.ant-btn-sm.ml-2'

"""任务开始前"""
# 数据上传按钮
data_add_button = By.CSS_SELECTOR, ".ant-btn.css-170tjox.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid.ant-btn-background-ghost"
# 第一个任务查看按钮
first_task_check_button = By.XPATH, '//table/tbody/tr[1]/td[last()]/a[text()="查看"]'
# 点击上传按钮
data_text_primary = By.CLASS_NAME, "text-primary"
# 输入数据文件的路径
data_file_path = 'E:\\word\\1.jsonl'
# 确定按钮
data_confirm = By.XPATH, "//*[@class='ant-modal-footer']/button[2]"
# 清空按钮
data_clear = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-link.ant-btn-dangerous.ant-btn-color-dangerous.ant-btn-variant-link'
# 是否清空的确认按钮
data_clear_confirm = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid.ant-btn-sm'
# 答题倒计时
data_answer_countdown = By.ID, 'expire_time'
# 标注团队
data_answer_team = By.CLASS_NAME, 'ant-select-selector'
# 标注小组
data_one_of_answer_team = (By.XPATH, "//div[@class='rc-virtual-list-holder-inner']/div[@title='{}']")  # 动态选择标注小组
# data_one_of_answer_team=By.XPATH,"//div[@class='rc-virtual-list-holder-inner']/div[@title='标注小组1']"
# 开始任务按钮
start_task_button = By.XPATH, "//button[@class='ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid']"


"""任务开始后"""
# 任务开始后的数据上传按钮
task_start_data_add=By.XPATH,'//button[@class="ant-btn css-170tjox ant-btn-link ant-btn-color-primary ant-btn-variant-link !pr-0"]'
#点击 点击上传
task_start_text_primary=By.CSS_SELECTOR,".flex.flex-col.items-center.py-8"
#标注团队的修改按钮
task_team_edit=By.CSS_SELECTOR,'.ant-btn.css-170tjox.ant-btn-link.ant-btn-color-primary.ant-btn-variant-link.ant-btn-icon-only.h-auto'
#修改后的确定按钮
task_team_edit_confirm=By.CSS_SELECTOR,".anticon.anticon-check.mx-1.text-primary"
#修改的取消按钮
task_team_edit_close=By.CSS_SELECTOR,".anticon.anticon-close.mx-1.text-primary"
#搜索框
task_name_search=By.ID,"username"
#搜索按钮
task_name_search_button=By.XPATH,"//button[@class='ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid']"
#统计分析
task_state_analyse=By.XPATH,"//button[@class='ant-btn css-170tjox ant-btn-link ant-btn-color-primary ant-btn-variant-link !p-0']"
#数据分布
task_data_distribute=By.XPATH,'//div[@class="ant-tabs-tab ant-tabs-tab-active"]'
#针对对话里每条回复,针对对话里的每个提问
task_in_conversation=(By.XPATH,'(//label[@class="ant-radio-button-wrapper css-170tjox"])[{}]')
# task_reply_in_conversation=By.XPATH,'(//label[@class="ant-radio-button-wrapper css-170tjox"])[1]'
# task_question_in_conversation=By.XPATH,'(//label[@class="ant-radio-button-wrapper css-170tjox"])[2]'
#针对整段内容/对话
task_content_in_conversation=By.XPATH,'/html/body/div[2]/div/div[3]/div/div[2]/div/div[2]/div/div[1]/div/div/div[1]/label[1]'
#数据筛选
task_data_filter=By.XPATH,'//div[@data-node-key="without_duplicate"]'
#单题标注结果，源题多结果对比
task_result=(By.XPATH,'/html/body/div[2]/div/div[3]/div/div[2]/div/div[2]/div/div[2]/div/div[1]/label[{}]')#1,2
# task_single_results=By.XPATH,'/html/body/div[2]/div/div[3]/div/div[2]/div/div[2]/div/div[2]/div/div[1]/label[1]'
# task_result_compare=By.XPATH,'/html/body/div[2]/div/div[3]/div/div[2]/div/div[2]/div/div[2]/div/div[1]/label[2]'
#设置筛选信息
#模块，题目，选项
task_frame_select=(By.XPATH,'(//*[@class="ant-select-selector"])[{}]')#1,2,3
"""
task_module=By.XPATH,'(//*[@class="ant-select-selector"])[1]'
task_topic=By.XPATH,'(//*[@class="ant-select-selector"])[2]'
task_option=By.XPATH,'(//*[@class="ant-select-selector"])[3]'
"""
#第一个结果的第一个框的选项 针对整段内容/对话,针对对话里每条回复,针对对话里的每个提问
#第一个结果的第二个框的选项 1（对话类型，对话质量评估）2（回答清晰度，回答详细程度，对话质量评估）3（问题类型，问题难度，问题清晰度）
#第一个结果的第三个框的选项 1.1（课程讲解，作业辅导，考试答疑，职业规划）1.2（优秀，良好，一般，较差）
#2.1（非常清晰，清晰，一般，不清晰）2.2（非常详细，详细，一般，简略）2.3（完全解决，部分解决，未解决）
#3.1（概念理解，技能应用，分析推理，综合评价）3.2（简单，中等，困难）3.3（非常清晰，清晰，一般，不清晰）
#第二个结果的第一个框的选项 针对整段内容/对话,针对对话里每条回复,针对对话里的每个提问
#第二个结果的第二个框的选项 1（对话类型，对话质量评估）2（回答清晰度，回答详细程度，对话质量评估）3（问题类型，问题难度，问题清晰度）
#第二个结果的第三个框的选项 均一致,存在不一致
task_selection=(By.XPATH,'//div[@title="{}"]')
"""
task_entire_conversation=By.XPATH,'//div[@title="针对整段内容/对话"]'
task_each_reply_conversation=By.XPATH,'//div[@title="针对对话里每条回复"]'
task_every_question_conversation=By.XPATH,'//div[@title="针对对话里的每个提问"]'
task_conversation_type=By.XPATH,'//div[@title="对话类型"]'
task_conversation_quality=By.XPATH,'//div[@title="对话质量评估"]'
task_answer_clare=By.XPATH,'//div[@title="回答清晰度"]'
task_answer_detail=By.XPATH,'//div[@title="回答详细程度"]'
task_answer_solved=By.XPATH,'//div[@title="回答是否解决问题"]'
task_question_type=By.XPATH,'//div[@title="问题类型"]'
task_question_difficulty=By.XPATH,'//div[@title="问题难度"]'
task_question_clarity=By.XPATH,'//div[@title="问题清晰度"]'
task_consistent=By.XPATH,'//div[@title="均一致"]'
task_inconsistent=By.XPATH,'//div[@title="存在不一致"]'
"""
#关闭统计分析
task_close_analyse=By.CLASS_NAME,'ant-drawer-close'
#查看题目
task_check_question=By.XPATH,'//*[@id="root"]/div/div/div[2]/div[2]/main/div/div/div/div/div/div[2]/div[2]/div[2]/div[4]/a'
#单题展示
task_single_question=By.XPATH,'/html/body/div[2]/div/ul/li[1]'
#关闭内容对比
task_close_content_compare=By.XPATH,'//*[@class="inline-block cursor-pointer p-1 leading-none hover:bg-fill-tertiary"]'
#换一题
task_change_subject=By.XPATH,'//*[@class="ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid"]'
#源题组合展示
task_multiple_questions=By.XPATH,'/html/body/div[2]/div/ul/li[2]'
#下载
task_download=By.XPATH,'//*[@class="ant-btn css-170tjox ant-btn-text ant-btn-color-default ant-btn-variant-text ant-dropdown-trigger"]'
#导出下载量
task_export_downloads=By.XPATH,'//*[@class="ant-btn css-170tjox ant-btn-link ant-btn-color-primary ant-btn-variant-link ml-2 !px-0"]'
#结束任务
task_end=By.XPATH,'//*[@class="text-error hover:text-error"]'
#点击确定
task_end_confirm=By.XPATH,'//*[@class="ant-btn css-170tjox ant-btn-primary ant-btn-dangerous ant-btn-color-dangerous ant-btn-variant-solid"]'
#...
task_more=By.XPATH,'//*[@class="ant-btn css-170tjox ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only ant-dropdown-trigger ml-4"]'
#删除任务
task_delete=By.XPATH,'//*[@class="ant-dropdown-menu-title-content"]'







"""以下是任务监控模块涉及元素 配置信息"""
# 查看按钮
task_list_check_button = (By.XPATH, '//table/tbody/tr[{}]/td[last()]/a[text()="查看"]')
# 任务名称输入框
task_name_input = By.ID, 'title'
# 状态框
task_status_check = By.ID, "status"
# 选择状态（待开始，进行中，已结束）
task_status = (By.XPATH, "//*[@class='rc-virtual-list-holder-inner']/div[@title='{}']")
# 创建人
task_creator_id = By.ID, "creator_id"
# 滚动条轨道
scrollbar_track = By.CSS_SELECTOR, "div.rc-virtual-list-scrollbar"
# 滑块
slider = By.CSS_SELECTOR, "div.rc-virtual-list-scrollbar-thumb"
# 选择创建人（团队成员）
task_creator_name = (By.XPATH, "//div[@class='rc-virtual-list-holder-inner']/div[@title='{}']")
# 任务搜索按钮
task_search_button = By.CSS_SELECTOR, '.ant-btn.css-170tjox.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'
# 更多工具
more_tools = By.CSS_SELECTOR, ".ant-btn.css-170tjox.ant-btn-link.ant-btn-color-primary.ant-btn-variant-link"
# 下一页按钮
task_page_next = By.CLASS_NAME, "ant-pagination-next"
# 上一页按钮
task_page_prev = By.CLASS_NAME, "ant-pagination-prev"
#标注团队
task_team=By.XPATH,'//*[@class="ant-menu-item ant-menu-item-only-child ant-pro-base-menu-inline-menu-item"]'




"""以下是标注团队模块涉及元素 配置信息"""
#用户管理
task_user_management=By.CLASS_NAME, 'ant-menu-submenu-title'
#标注团队
task_all_team=By.XPATH,'(//*[@class="ant-pro-base-menu-inline-item-text css-nv2dra"])[1]'
#添加用户
task_add_user=By.XPATH,'(//*[@class="ant-btn css-170tjox ant-btn-default ant-btn-color-default ant-btn-variant-outlined"])[1]'
#添加用户时直接点确定，获取错误信息
task_add_err_info=(By.XPATH,'(//*[@class="ant-form-item-explain-error"])[{}]')
#用户名
task_username=login_username
#密码
task_password=login_password
#确认密码
task_password2=By.ID,'password2'
#点击标注团队选择框
task_team_frame=By.XPATH,'(//*[@class="ant-select-selector"])[2]'
#选择标注团队
task_select_team=data_one_of_answer_team
#取消按钮
task_add_reject=By.XPATH,'(//*[@class="ant-btn css-170tjox ant-btn-default ant-btn-color-default ant-btn-variant-outlined"])[2]'
#确定按钮
task_add_confirm=By.XPATH,'(//*[@class="ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid"])[2]'
#新建团队
task_add_team=By.XPATH,'(//*[@class="ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid"])[1]'
#不输入团队名称点击确定，获取错误信息
task_team_err_info=By.XPATH,'(//*[@class="ant-form-item-explain-error"])'
#团队名称
task_team_name=By.ID,'name'
#联系人
task_team_owner=By.ID,'owner'
#联系人电话
task_team_owner_phone=By.ID,'owner_cellphone'
#获取错误手机号的信息,task_team_err_info
#取消
#第n行的编辑按钮n,1
task_team_select=(By.XPATH, '//table/tbody/tr[{}]/td[last()]/div/div[{}]/a')
#团队名称,task_team_name
#联系人，task_team_owner
#联系人电话，task_team_owner_phone
#确定，task_add_confirm
#提交成功信息，message_info
#第n行的成员管理按钮,task_team_select.format(n,2)
#搜索,task_team_name
#搜索按钮=新建团队按钮
#邀请成员按钮=确定按钮
#复制链接
task_invite_link=By.XPATH,'//*[@class="ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid ant-btn-block !rounded-none h-full !w-[104px]"]'
#获取复制成功信息，message_info
#重新生成链接
task_refresh_link=By.XPATH,'//*[@class="text-primary cursor-pointer"]'
#关闭邀请成员页面
task_close_invite=By.XPATH,'//*[@class="ant-modal-close"]'
#移除成员
task_remove_member=By.XPATH,'//table/tbody/tr[1]/td[last()]/button'
#确认按钮
task_remove_member_confirm=By.XPATH,'(//*[@class="ant-btn css-170tjox ant-btn-primary ant-btn-color-primary ant-btn-variant-solid"])[3]'




"""以下是运营成员模块涉及元素 配置信息"""
task_operational_members=By.XPATH,'(//*[@class="ant-pro-base-menu-inline-item-text css-nv2dra"])[2]'